package com.care.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="doctor")
public class Doctor {
	private int id;
	private String name;//名字
	private String password;//密码
	private String sex;//性别
	private String img;//照片
	private String information;//信息
	private double money;//金钱
	private String section;//科室
	private String email;//邮箱
	private Set<Knowledge> knowledges = new HashSet<Knowledge>();
	public Doctor(){
		
	}
	
	

	public Doctor(String name, String password, String sex, String information, double money, String section,
			String email) {
		super();
		this.name = name;
		this.password = password;
		this.sex = sex;
		this.information = information;
		this.money = money;
		this.section = section;
		this.email = email;
	}



	public Doctor(int id, String name, String password, String sex, String img, String information, double money,
			String section, String email, Set<Knowledge> knowledges) {
		super();
		this.id = id;
		this.name = name;
		this.password = password;
		this.sex = sex;
		this.img = img;
		this.information = information;
		this.money = money;
		this.section = section;
		this.email = email;
		this.knowledges = knowledges;
	}



	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	@Column(name="name")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name="password")
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	@Column(name="img")
	public String getImg() {
		return img;
	}
	public void setImg(String img) {
		this.img = img;
	}
	@Column(name="information")
	public String getInformation() {
		return information;
	}

	public void setInformation(String information) {
		this.information = information;
	}
	@Column(name="money")
	public double getMoney() {
		return money;
	}

	public void setMoney(double money) {
		this.money = money;
	}
	@Column(name="section")
	public String getSection() {
		return section;
	}


	public void setSection(String section) {
		this.section = section;
	}

	@Column(name="email")
	public String getEmail() {
		return email;
	}


	public void setEmail(String email) {
		this.email = email;
	}
	
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="doctor")
	public Set<Knowledge> getKnowledges() {
		return knowledges;
	}


	public void setKnowledges(Set<Knowledge> knowledges) {
		this.knowledges = knowledges;
	}

	
	@Column(name="sex")
	public String getSex() {
		return sex;
	}



	public void setSex(String sex) {
		this.sex = sex;
	}



	@Override
	public String toString() {
		return "Doctor [id=" + id + ", name=" + name + ", password=" + password + ", img=" + img + ", information="
				+ information + ", money=" + money + ", section=" + section + ", email=" + email + "]";
	}
	
}
